scsi: hisi_sas: Create separate host attributes per HBA
authorXiang Chen <chenxiang66@hisilicon.com>
Fri, 9 Nov 2018 14:06:32 +0000 (22:06 +0800)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 18 Jul 2019 22:23:17 +0000 (23:23 +0100)
Currently all the three HBA (v1/v2/v3 HW) share the same host attributes.

To support each HBA having separate attributes in future, create per-HBA
attributes.

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Gbp-Pq: Topic bugfix/arm64/huawei-taishan
Gbp-Pq: Name 0010-scsi-hisi_sas-Create-separate-host-attributes-per-HB.patch

drivers/scsi/hisi_sas/hisi_sas.h
drivers/scsi/hisi_sas/hisi_sas_main.c
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

index 0ddb53c8a2e29fe5b83fa8eb0319ce9fb8c5ea9f..94a9e13c069cbc9277c555aa9338050049450203 100644 (file)
@@ -468,7 +468,6 @@ extern int hisi_sas_remove(struct platform_device *pdev);
 extern int hisi_sas_slave_configure(struct scsi_device *sdev);
 extern int hisi_sas_scan_finished(struct Scsi_Host *shost, unsigned long time);
 extern void hisi_sas_scan_start(struct Scsi_Host *shost);
-extern struct device_attribute *host_attrs[];
 extern int hisi_sas_host_reset(struct Scsi_Host *shost, int reset_type);
 extern void hisi_sas_phy_down(struct hisi_hba *hisi_hba, int phy_no, int rdy);
 extern void hisi_sas_slot_task_free(struct hisi_hba *hisi_hba,
index c2998d3ac37f62565836c7525b1a19b8ee18c017..dc71f8d835510bdb5fc56331ccc49474b0177282 100644 (file)
@@ -2009,12 +2009,6 @@ EXPORT_SYMBOL_GPL(hisi_sas_kill_tasklets);
 struct scsi_transport_template *hisi_sas_stt;
 EXPORT_SYMBOL_GPL(hisi_sas_stt);
 
-struct device_attribute *host_attrs[] = {
-       &dev_attr_phy_event_threshold,
-       NULL,
-};
-EXPORT_SYMBOL_GPL(host_attrs);
-
 static struct sas_domain_function_template hisi_sas_transport_ops = {
        .lldd_dev_found         = hisi_sas_dev_found,
        .lldd_dev_gone          = hisi_sas_dev_gone,
index 8df822a4a1bd6624abb8814a70e8bdc502274192..e8e3a876e4934ca1074d3b1b6286b7a569791305 100644 (file)
@@ -1797,6 +1797,11 @@ static int hisi_sas_v1_init(struct hisi_hba *hisi_hba)
        return 0;
 }
 
+static struct device_attribute *host_attrs_v1_hw[] = {
+       &dev_attr_phy_event_threshold,
+       NULL
+};
+
 static struct scsi_host_template sht_v1_hw = {
        .name                   = DRV_NAME,
        .module                 = THIS_MODULE,
@@ -1815,7 +1820,7 @@ static struct scsi_host_template sht_v1_hw = {
        .eh_target_reset_handler = sas_eh_target_reset_handler,
        .target_destroy         = sas_target_destroy,
        .ioctl                  = sas_ioctl,
-       .shost_attrs            = host_attrs,
+       .shost_attrs            = host_attrs_v1_hw,
 };
 
 static const struct hisi_sas_hw hisi_sas_v1_hw = {
index 77a85ead483e098a8e1d837c8130bfb873dc3671..574a269e28652ece5f39a94855baa8c6a1e6940f 100644 (file)
@@ -3552,6 +3552,11 @@ static void wait_cmds_complete_timeout_v2_hw(struct hisi_hba *hisi_hba,
        dev_dbg(dev, "wait commands complete %dms\n", time);
 }
 
+struct device_attribute *host_attrs_v2_hw[] = {
+       &dev_attr_phy_event_threshold,
+       NULL
+};
+
 static struct scsi_host_template sht_v2_hw = {
        .name                   = DRV_NAME,
        .module                 = THIS_MODULE,
@@ -3570,7 +3575,7 @@ static struct scsi_host_template sht_v2_hw = {
        .eh_target_reset_handler = sas_eh_target_reset_handler,
        .target_destroy         = sas_target_destroy,
        .ioctl                  = sas_ioctl,
-       .shost_attrs            = host_attrs,
+       .shost_attrs            = host_attrs_v2_hw,
 };
 
 static const struct hisi_sas_hw hisi_sas_v2_hw = {
index 43005d39abe60182bd0a7dfbcd1c6c2b1194dfef..1d0896959fbb75b2b29fa7ef9b8b2d52fd31b17d 100644 (file)
@@ -2089,6 +2089,11 @@ static void wait_cmds_complete_timeout_v3_hw(struct hisi_hba *hisi_hba,
        dev_dbg(dev, "wait commands complete %dms\n", time);
 }
 
+struct device_attribute *host_attrs_v3_hw[] = {
+       &dev_attr_phy_event_threshold,
+       NULL
+};
+
 static struct scsi_host_template sht_v3_hw = {
        .name                   = DRV_NAME,
        .module                 = THIS_MODULE,
@@ -2107,7 +2112,7 @@ static struct scsi_host_template sht_v3_hw = {
        .eh_target_reset_handler = sas_eh_target_reset_handler,
        .target_destroy         = sas_target_destroy,
        .ioctl                  = sas_ioctl,
-       .shost_attrs            = host_attrs,
+       .shost_attrs            = host_attrs_v3_hw,
        .tag_alloc_policy       = BLK_TAG_ALLOC_RR,
 };